#pragma once
#include "rbtree.h"
template<class k>
class set
{
public:
    struct setkeyoft
    {
        const k& operator()(const k& key)
        {
            return key;
        }
    };
    typedef typename rbtree<k,const k,setkeyoft>::Iterator iterator;
    typedef typename rbtree<k, const k, setkeyoft>::const_Iterator const_iterator;
    typedef  rbtreenode<k> node;
    iterator begin()
    {
        return _rbtree.begin();
    }
    iterator end()
    {
        return _rbtree.end();
    }
    const_iterator begin() const 
    {
        return _rbtree.begin();
    }
    const_iterator end() const
    {
        return _rbtree.end();
    }
    void insert(k key)
    {
        _rbtree.insert(key);
    }
    iterator find(const k& key)
    {
        return _rbtree.find(key);
    }
private:
    rbtree<k, const k, setkeyoft> _rbtree;//set中的data是不允许修改的
};